package com.drm.netschool.mapper;

import com.drm.netschool.entity.SumerHostTag;
import com.drm.netschool.entity.SumerHostTagExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface SumerHostTagMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_host_tag
     *
     * @mbggenerated Thu Aug 13 10:47:25 CST 2015
     */
    int countByExample(SumerHostTagExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_host_tag
     *
     * @mbggenerated Thu Aug 13 10:47:25 CST 2015
     */
    int deleteByExample(SumerHostTagExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_host_tag
     *
     * @mbggenerated Thu Aug 13 10:47:25 CST 2015
     */
    @Delete({
        "delete from sumer_host_tag",
        "where host_id = #{hostId,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String hostId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_host_tag
     *
     * @mbggenerated Thu Aug 13 10:47:25 CST 2015
     */
    @Insert({
        "insert into sumer_host_tag (host_id, tag_id)",
        "values (#{hostId,jdbcType=VARCHAR}, #{tagId,jdbcType=BIGINT})"
    })
    int insert(SumerHostTag record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_host_tag
     *
     * @mbggenerated Thu Aug 13 10:47:25 CST 2015
     */
    int insertSelective(SumerHostTag record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_host_tag
     *
     * @mbggenerated Thu Aug 13 10:47:25 CST 2015
     */
    List<SumerHostTag> selectByExample(SumerHostTagExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_host_tag
     *
     * @mbggenerated Thu Aug 13 10:47:25 CST 2015
     */
    @Select({
        "select",
        "host_id, tag_id",
        "from sumer_host_tag",
        "where host_id = #{hostId,jdbcType=VARCHAR}"
    })
    @ResultMap("BaseResultMap")
    SumerHostTag selectByPrimaryKey(String hostId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_host_tag
     *
     * @mbggenerated Thu Aug 13 10:47:25 CST 2015
     */
    int updateByExampleSelective(@Param("record") SumerHostTag record, @Param("example") SumerHostTagExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_host_tag
     *
     * @mbggenerated Thu Aug 13 10:47:25 CST 2015
     */
    int updateByExample(@Param("record") SumerHostTag record, @Param("example") SumerHostTagExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_host_tag
     *
     * @mbggenerated Thu Aug 13 10:47:25 CST 2015
     */
    int updateByPrimaryKeySelective(SumerHostTag record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sumer_host_tag
     *
     * @mbggenerated Thu Aug 13 10:47:25 CST 2015
     */
    @Update({
        "update sumer_host_tag",
        "set tag_id = #{tagId,jdbcType=BIGINT}",
        "where host_id = #{hostId,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(SumerHostTag record);
}